Skip to content

Conversation

@scottmcm
Copy link
Member

This was a bad idea before, but now that size_of and align_of work completely differently than when removing it was first tried in 2020, maybe it makes sense now.

(Or maybe I'll just add another attempt to the list in the comments...)

r? ghost

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 19, 2025
@scottmcm
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 19, 2025
See if this is the time we can remove `layout::size_align`
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 19, 2025
@rust-log-analyzer

This comment has been minimized.

This was a bad idea before, but now that `size_of` and `align_of` work completely differently than when removing it was first tried in 2020, maybe it makes sense now.

(Or maybe I'll just add another attempt to the list in the comments...)
@rust-bors
Copy link

rust-bors bot commented Nov 19, 2025

☀️ Try build successful (CI)
Build commit: 032b547 (032b5475d8c280e662d536ab2bb6b2f7f57a934e, parent: 07bdbaedc63094281483c40a88a1a8f2f8ffadc5)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (032b547): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.1% [1.1%, 1.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.7% [-1.3%, -0.1%] 10
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 3.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.9% [3.3%, 4.5%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.9% [3.3%, 4.5%] 2

Cycles

Results (primary -2.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.6% [-2.6%, -2.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.6% [-2.6%, -2.6%] 1

Binary size

Results (primary -0.1%, secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 2
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
-0.2% [-0.4%, -0.0%] 23
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-0.4%, 0.0%] 25

Bootstrap: 477.858s -> 472.077s (-1.21%)
Artifact size: 388.67 MiB -> 388.71 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Nov 19, 2025
@scottmcm scottmcm force-pushed the align-always-alignment branch from 2bf4c01 to 30f4a2a Compare November 20, 2025 06:09
@scottmcm
Copy link
Member Author

@rustbot ready
r? @tgross35 (feel free to reassign; github just had you as suggested so why not)

Those perf results look clearly not-worse to me, and they might be amazing if that bootstrap saving 4.441 seconds on a single crate (rustc_builtin_macros) is real.

(It's probably not actually that good, but I'm happy to take less "weird enough to need a comment" code in the library for what looks like it's probably a small net perf improvement.)

@tgross35
Copy link
Contributor

That's a world of difference from the 5-25% regressions in #72189 (cc @nnethercote in case that's been in the back of your head). Great work compiler team.

r? @tgross35 (feel free to reassign; github just had you as suggested so why not)

No idea why, don't think I've touched this code 😆 but it works for me

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 20, 2025

📌 Commit 30f4a2a has been approved by tgross35

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 20, 2025
@nnethercote
Copy link
Contributor

Haha, nice!

@scottmcm
Copy link
Member Author

Shout-out to @saethlin (#126793) and @cjgillot (#147793) for doing the hard parts here 🙂

@bors
Copy link
Collaborator

bors commented Nov 20, 2025

⌛ Testing commit 30f4a2a with merge 53732d5...

@bors
Copy link
Collaborator

bors commented Nov 20, 2025

☀️ Test successful - checks-actions
Approved by: tgross35
Pushing 53732d5 to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 20, 2025
@bors bors merged commit 53732d5 into rust-lang:main Nov 20, 2025
12 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 20, 2025
@github-actions
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 7281a3b (parent) -> 53732d5 (this PR)

Test differences

Show 26 test diffs

26 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 53732d5e076329a62f71d3c6901886ce8a71e812 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-x86_64-apple: 9435.9s -> 6403.1s (-32.1%)
  2. dist-aarch64-apple: 7486.8s -> 5657.7s (-24.4%)
  3. dist-apple-various: 5296.1s -> 4281.6s (-19.2%)
  4. x86_64-gnu-aux: 7140.9s -> 5994.5s (-16.1%)
  5. dist-aarch64-windows-gnullvm: 4342.6s -> 4987.6s (+14.9%)
  6. dist-x86_64-windows-gnullvm: 4713.3s -> 5321.4s (+12.9%)
  7. aarch64-gnu-llvm-20-1: 3972.1s -> 3508.2s (-11.7%)
  8. x86_64-rust-for-linux: 2961.9s -> 2616.2s (-11.7%)
  9. x86_64-gnu-tools: 3706.9s -> 3280.7s (-11.5%)
  10. pr-check-1: 1920.5s -> 1717.3s (-10.6%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (53732d5): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.4% [0.1%, 0.6%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.7% [-1.3%, -0.2%] 8
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 1.4%, secondary -1.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.7% [1.6%, 5.7%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
-1.2% [-1.2%, -1.2%] 1
All ❌✅ (primary) 1.4% [-3.0%, 5.7%] 3

Cycles

Results (secondary -2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.9% [4.9%, 4.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.9% [-4.9%, -2.2%] 5
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.1%, secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 1
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
-0.1% [-0.4%, -0.0%] 27
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 2
All ❌✅ (primary) -0.1% [-0.4%, 0.0%] 28

Bootstrap: 472.196s -> 471.595s (-0.13%)
Artifact size: 388.85 MiB -> 388.91 MiB (0.02%)

@scottmcm scottmcm deleted the align-always-alignment branch November 21, 2025 06:19
@scottmcm
Copy link
Member Author

Ok, those perf results make more sense. Still seem roughly neutral-to-green, which is all I was going for with a cleanup -- as tgross35 mentioned previous attempts were obviously worse than neutral.

@panstromek
Copy link
Contributor

Negative results are all noise (include-blob is noisy and together with tuple-stress returned to previous state in next rollup), so this really is neutral to green.

@panstromek
Copy link
Contributor

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants